package org.zjx.common.entity;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class ParagraphBean {
    private List<Categories> children;


    public void add(Categories categories) {
        if (children == null) children = new ArrayList<Categories>();
        children.add(categories);
    }


    @Data
    public static class Categories{
        private String category;
        private List<Word> words;

        public void addWord(Word word){
            if(words == null) words = new ArrayList<Word>();
            words.add(word);
        }
    }

    @Data
    public static class Word{
        private String name;
        private Rect rect;

        public Word(String name, Rect rect) {
            this.name = name;
            this.rect = rect;
        }
    }
}


